<?php


class MembersModel extends Model{

	//设置数据库名称
	protected $dbName = 'discuz';
	protected $tablePrefix = 'cdb_';

	public function checkLogin($uid, $password)
	{
		$memberInfo = $this->where(array('uid' => $uid, 'password' => $password))->find();

		if( $memberInfo ){

			$member = array(
					'uid' => $uid,
					'username' => $memberInfo['username'],
                                        'study_status' => 0
					);
			$_SESSION['current_member'] = $member;

			return true;
		}else{
			return false;
		}
		
	}


}

?>